package com.jiwang.mail.util.result;

/**
 * @author 沈伟峰
 */
public class ResultFactory {


    public static JsonResult newJsonResult() {
        return JsonResult.newInstance();
    }

    public static JsonResult newJsonResult(ResultStatus status) {
        return JsonResult.newInstance(status);
    }

    public static JsonResult newJsonResult(int code, String messageEN, String messageZH) {
        return JsonResult.newInstance(new ResultStatus(code, messageEN, messageZH));
    }

    public static JsonResult newJsonResult(ResultStatus status, String message, Object data) {
        return JsonResult.newInstance(status, message, data);
    }

    public static JsonResult newJsonResult(ResultStatus status, String[] messages, Object data) {
        return JsonResult.newInstance(status, messages, data);
    }

    public static JsonResult newSuccessJsonResult() {
        return newJsonResult(ResultStatus.SUCCESS);
    }

    public static JsonResult newSuccessJsonResult(Object data) {
        return newJsonResult(ResultStatus.SUCCESS).setData(data);
    }

    public static JsonResult newFailJsonResult() {
        return newJsonResult(ResultStatus.FAIL);
    }
}
